//
//  ScoreTableViewCell.m
//  BaseProject
//
//  Created by hundredsandc on 2017/10/28.
//  Copyright © 2017年 hundredsandc. All rights reserved.
//

#import "ScoreTableViewCell.h"

@interface ScoreTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *teamOneRedCard;
@property (weak, nonatomic) IBOutlet UILabel *teamOneYellowCard;
@property (weak, nonatomic) IBOutlet UILabel *teamOneName;
@property (weak, nonatomic) IBOutlet UILabel *teamOneScore;
@property (weak, nonatomic) IBOutlet UILabel *teamTwoScore;
@property (weak, nonatomic) IBOutlet UILabel *teamTwoName;
@property (weak, nonatomic) IBOutlet UILabel *teamTwoYellowCard;
@property (weak, nonatomic) IBOutlet UILabel *teamTwoRedCard;
@property (weak, nonatomic) IBOutlet UILabel *leftSubTitle;
@property (weak, nonatomic) IBOutlet UILabel *rightSubTitle;

@end
@implementation ScoreTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)customTitle:(NSString *)title time:(NSString *)time teamOneRed:(NSString *)teamOneRed teamOneYellow:(NSString *)teamOneYellow teamOneName:(NSString *)teamOneName teamOneScore:(NSString *)teamOneScore teamTwoRed:(NSString *)teamTwoRed teamTwoYellow:(NSString *)teamTwoYellow teamTwoName:(NSString *)teamTwoName teamTwoScore:(NSString*)teamTwoScore leftSub:(NSString *)leftSub rightSub:(NSString *)rightSub{
    _teamTwoYellowCard.hidden = NO;
    _teamTwoRedCard.hidden = NO;
    _teamOneYellowCard.hidden = NO;
    _teamOneRedCard.hidden = NO;
    _teamOneName.adjustsFontSizeToFitWidth = YES;
    _teamTwoName.adjustsFontSizeToFitWidth = YES;
    
    _titleLabel.text = title;
    _timeLabel.text = time;
    _teamOneRedCard.text = teamOneRed;
    if (teamOneRed.length==0||[teamOneRed isEqualToString:@"0"]) {
        _teamOneRedCard.hidden = YES;
    }
    _teamOneYellowCard.text = teamOneYellow;
    if (teamOneYellow.length==0||[teamOneYellow isEqualToString:@"0"]) {
        _teamOneYellowCard.hidden = YES;
    }
    _teamOneName.text = teamOneName;
    _teamOneScore.text = teamOneScore;
    _teamTwoRedCard.text = teamTwoRed;
    if (teamTwoRed.length==0||[teamTwoRed isEqualToString:@"0"]) {
        _teamTwoRedCard.hidden= YES;
    }
    _teamTwoYellowCard.text = teamTwoYellow;
    if (teamTwoYellow.length==0||[teamTwoYellow isEqualToString:@"0"]) {
        _teamTwoYellowCard.hidden = YES;
    }
    _teamTwoName.text = teamTwoName;
    _teamTwoScore.text = teamTwoScore;
    
    _leftSubTitle.text = leftSub;
    _rightSubTitle.text = rightSub;
    _leftSubTitle.hidden = YES;
    _rightSubTitle.hidden = YES;

}
@end
